
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>IconFont</title>
    <link rel="stylesheet" href="demo.css">
    <script src="iconfont.js"></script>

    <style type="text/css">
        .icon {
          /* 通过设置 font-size 来改变图标大小 */
          width: 1em; height: 1em;
          /* 图标和文字相邻时，垂直对齐 */
          vertical-align: -0.15em;
          /* 通过设置 color 来改变 SVG 的颜色/fill */
          fill: currentColor;
          /* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
             normalize.css 中也包含这行 */
          overflow: hidden;
        }

    </style>
</head>
<body>
    <div class="main markdown">
        <h1>IconFont 图标</h1>
        <ul class="icon_lists clear">
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-password"></use>
                    </svg>
                    <div class="name">密码</div>
                    <div class="fontclass">#icon-password</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-user"></use>
                    </svg>
                    <div class="name">用户</div>
                    <div class="fontclass">#icon-user</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-yuwen"></use>
                    </svg>
                    <div class="name">语文</div>
                    <div class="fontclass">#icon-yuwen</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shuxue"></use>
                    </svg>
                    <div class="name">数学</div>
                    <div class="fontclass">#icon-shuxue</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-yingyu"></use>
                    </svg>
                    <div class="name">英语</div>
                    <div class="fontclass">#icon-yingyu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-wuli"></use>
                    </svg>
                    <div class="name">物理</div>
                    <div class="fontclass">#icon-wuli</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-huaxue"></use>
                    </svg>
                    <div class="name">化学</div>
                    <div class="fontclass">#icon-huaxue</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shengwu"></use>
                    </svg>
                    <div class="name">生物</div>
                    <div class="fontclass">#icon-shengwu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-zhengzhi"></use>
                    </svg>
                    <div class="name">政治</div>
                    <div class="fontclass">#icon-zhengzhi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-lishi"></use>
                    </svg>
                    <div class="name">历史</div>
                    <div class="fontclass">#icon-lishi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-dili"></use>
                    </svg>
                    <div class="name">地理</div>
                    <div class="fontclass">#icon-dili</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-dianhua"></use>
                    </svg>
                    <div class="name">电话</div>
                    <div class="fontclass">#icon-dianhua</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-tianqi"></use>
                    </svg>
                    <div class="name">天气</div>
                    <div class="fontclass">#icon-tianqi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-zhaoming"></use>
                    </svg>
                    <div class="name">照明</div>
                    <div class="fontclass">#icon-zhaoming</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-wenjianjia"></use>
                    </svg>
                    <div class="name">文件夹</div>
                    <div class="fontclass">#icon-wenjianjia</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shezhi"></use>
                    </svg>
                    <div class="name">设置</div>
                    <div class="fontclass">#icon-shezhi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-zhuye"></use>
                    </svg>
                    <div class="name">主页</div>
                    <div class="fontclass">#icon-zhuye</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-jisuanqi"></use>
                    </svg>
                    <div class="name">计算器</div>
                    <div class="fontclass">#icon-jisuanqi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-zhinanzhen"></use>
                    </svg>
                    <div class="name">指南针</div>
                    <div class="fontclass">#icon-zhinanzhen</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-xinxi"></use>
                    </svg>
                    <div class="name">信息</div>
                    <div class="fontclass">#icon-xinxi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-lianxiren"></use>
                    </svg>
                    <div class="name">联系人</div>
                    <div class="fontclass">#icon-lianxiren</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-yingyongshangdian"></use>
                    </svg>
                    <div class="name">应用商店</div>
                    <div class="fontclass">#icon-yingyongshangdian</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shizhong"></use>
                    </svg>
                    <div class="name">时钟</div>
                    <div class="fontclass">#icon-shizhong</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-xiangji"></use>
                    </svg>
                    <div class="name">相机</div>
                    <div class="fontclass">#icon-xiangji</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-zhuti"></use>
                    </svg>
                    <div class="name">主题</div>
                    <div class="fontclass">#icon-zhuti</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-rili"></use>
                    </svg>
                    <div class="name">日历</div>
                    <div class="fontclass">#icon-rili</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-qianbao"></use>
                    </svg>
                    <div class="name">钱包</div>
                    <div class="fontclass">#icon-qianbao</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-youxi"></use>
                    </svg>
                    <div class="name">游戏</div>
                    <div class="fontclass">#icon-youxi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-bofangqi"></use>
                    </svg>
                    <div class="name">播放器</div>
                    <div class="fontclass">#icon-bofangqi</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-ditu"></use>
                    </svg>
                    <div class="name">地图</div>
                    <div class="fontclass">#icon-ditu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-beiwanglu"></use>
                    </svg>
                    <div class="name">备忘录</div>
                    <div class="fontclass">#icon-beiwanglu</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-shouye"></use>
                    </svg>
                    <div class="name">首页</div>
                    <div class="fontclass">#icon-shouye</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-jiaoxue"></use>
                    </svg>
                    <div class="name">教学</div>
                    <div class="fontclass">#icon-jiaoxue</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-xitong"></use>
                    </svg>
                    <div class="name">系统</div>
                    <div class="fontclass">#icon-xitong</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-gerenxinxiicon-"></use>
                    </svg>
                    <div class="name">个人信息icon-16</div>
                    <div class="fontclass">#icon-gerenxinxiicon-</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-zhanghaoguanliicon-"></use>
                    </svg>
                    <div class="name">账号管理icon-07</div>
                    <div class="fontclass">#icon-zhanghaoguanliicon-</div>
                </li>
            
                <li>
                    <svg class="icon" aria-hidden="true">
                        <use xlink:href="#icon-xueyuanguanliicon-"></use>
                    </svg>
                    <div class="name">学员管理icon-11</div>
                    <div class="fontclass">#icon-xueyuanguanliicon-</div>
                </li>
            
        </ul>


        <h2 id="symbol-">symbol引用</h2>
        <hr>

        <p>这是一种全新的使用方式，应该说这才是未来的主流，也是平台目前推荐的用法。相关介绍可以参考这篇<a href="">文章</a>
        这种用法其实是做了一个svg的集合，与另外两种相比具有如下特点：</p>
        <ul>
          <li>支持多色图标了，不再受单色限制。</li>
          <li>通过一些技巧，支持像字体那样，通过<code>font-size</code>,<code>color</code>来调整样式。</li>
          <li>兼容性较差，支持 ie9+,及现代浏览器。</li>
          <li>浏览器渲染svg的性能一般，还不如png。</li>
        </ul>
        <p>使用步骤如下：</p>
        <h3 id="-symbol-">第一步：引入项目下面生成的symbol代码：</h3>
        <pre><code class="lang-js hljs javascript"><span class="hljs-comment">&lt;script src="./iconfont.js"&gt;&lt;/script&gt;</span></code></pre>
        <h3 id="-css-">第二步：加入通用css代码（引入一次就行）：</h3>
        <pre><code class="lang-js hljs javascript">&lt;style type=<span class="hljs-string">"text/css"</span>&gt;
.icon {
   width: <span class="hljs-number">1</span>em; height: <span class="hljs-number">1</span>em;
   vertical-align: <span class="hljs-number">-0.15</span>em;
   fill: currentColor;
   overflow: hidden;
}
&lt;<span class="hljs-regexp">/style&gt;</span></code></pre>
        <h3 id="-">第三步：挑选相应图标并获取类名，应用于页面：</h3>
        <pre><code class="lang-js hljs javascript">&lt;svg <span class="hljs-class"><span class="hljs-keyword">class</span></span>=<span class="hljs-string">"icon"</span> aria-hidden=<span class="hljs-string">"true"</span>&gt;<span class="xml"><span class="hljs-tag">
  &lt;<span class="hljs-name">use</span> <span class="hljs-attr">xlink:href</span>=<span class="hljs-string">"#icon-xxx"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">use</span>&gt;</span>
</span>&lt;<span class="hljs-regexp">/svg&gt;
        </span></code></pre>
    </div>
</body>
</html>
